//
//  LENowHeaderView.m
//  qqqqqq
//
//  Created by iOSer on 2017/3/16.
//  Copyright © 2017年 iOSer. All rights reserved.
//

#import "LENowHeaderView.h"
@interface LENowHeaderView()
@property(nonatomic,strong) UILabel *nameLab;
@property(nonatomic,strong) UILabel *priceLab;
@end
@implementation LENowHeaderView

+(instancetype)LENowHeaderView:(UITableView *)tableView{
    
    NSString * ID = [NSString stringWithFormat:@"LENowHeaderView"];
    LENowHeaderView* headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:ID];
    if (headerView == nil) {
        headerView = [[LENowHeaderView alloc] initWithReuseIdentifier:ID];
    }
    return headerView;
}

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    [self.contentView addSubview:self.nameLab];
    [self.contentView addSubview:self.priceLab];
    [_nameLab makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self.contentView);
        make.width.equalTo((SCREEN_WIDTH/2-40)/2);
    }];
    [_priceLab makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.right.equalTo(self.contentView);
        make.width.equalTo((SCREEN_WIDTH/2-40)/2);
    }];
}
-(UILabel *)nameLab{
    if (!_nameLab) {
        _nameLab = [[UILabel alloc] initWithTitle:@"商品名称" color:HEXColor(0x000000, 1) sizeFont:GGRealValue(10)];
        _nameLab.textAlignment = NSTextAlignmentCenter;
    }
    return _nameLab;
}

-(UILabel *)priceLab{
    if (!_priceLab) {
        _priceLab = [[UILabel alloc] initWithTitle:@"价格" color:HEXColor(0x000000, 1) sizeFont:GGRealValue(10)];
        _priceLab.textAlignment = NSTextAlignmentCenter;
    }
    return _priceLab;
}


@end
